Vue.js router
<router-view/>
の部分に、router/index.jsで、
配列で、 path, name, componentを入れていって、
export const router = new VueRouter( {routes})とrouterをexportする
code: index_router.js
const routes = [
{ path: '/', name: 'home', component: Home },
{
path: '/about',
name: 'about',
// route level code-splitting
// this generates a separate chunk (about.hash.js) for this route // which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
}
]
aboutの lazy loadは、関数呼び出しにすると、lazyにmなるということ?